﻿<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <SnippetTypes>
        <SnippetType>Expansion</SnippetType>
      </SnippetTypes>
      <Title>ORDGetProfileListByAlignmentName</Title>
      <Author>innovoCAD</Author>
      <Description>Code snippet for getting Profile string name list by Alignment Name.</Description>
      <HelpUrl>
      </HelpUrl>
      <Shortcut>ORDGetProfileListByAlignmentName</Shortcut>
    </Header>
    <Snippet>
     <References>
        <Reference>
          <Assembly>Bentley.CifNET.GeometryModel.SDK.4.0</Assembly>
        </Reference>
      </References>
      <Imports>
	  <Import>
          <Namespace>System.Collections.Generic</Namespace>
        </Import>
        <Import>
          <Namespace>SDK = Bentley.CifNET.GeometryModel.SDK</Namespace>
        </Import>
      </Imports>	
      <Code Language="vb" Delimiter="$"><![CDATA[    ''' <summary>Get Profile string name list by alignment name.</summary>
    ''' <param name="alignmentName"></param>
    Private Function GetProfilesByAlignmentName(ByVal alignmentName As String) As List(Of String)
        Dim profileNames As List(Of String) = New List(Of String)()
        Dim alignment As SDK.Alignment = SDKCon.GetActive().GetAlignmentByName(alignmentName)
        If 0 = alignment.Profiles.Count() Then
            profileNames.Add("None")
        Else
            For Each profile As SDK.Profile In alignment.Profiles
                profileNames.Add(profile.Name)
            Next
        End If

        Return profileNames
    End Function]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>